import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-08-17
 * Time: 15:48
 */
public class TraversalArray {
    public static void main(String[] args) {
        int[] array = {1, 2, 3, 4, 5, 6};
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i] + " ");
        }

        System.out.println();

        for (int x : array) {
            System.out.print(x + " ");
        }

        System.out.println();

        System.out.println(Arrays.toString(array));
    }
}
